#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N=60;
#define INF 1e9
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int n,m,a[N];
void solve()
{
	sd(n);sd(m);
	for(int i=0;i<n;i++) sd(a[i]);
	int l=0,r=INF;
	auto ok = [](int x)->bool 
	{
		ll tmp=0;
		for(int i=1;i<=n;i++)
			if(a[i]<x) tmp+=x-a[i];
		return tmp<=x&&tmp<=m;		
	};
	while(l<r)
	{
		int mid=l+r>>1;
		if(ok(mid)) l=mid+1;
		else r=mid;
	}
	pd(l);puts("");
}
int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}